package com.dobbinsoft.iotechn.device.api.open;

import com.dobbinsoft.iotechn.core.annotation.HttpMethod;
import com.dobbinsoft.iotechn.core.annotation.HttpOpenApi;
import com.dobbinsoft.iotechn.core.annotation.HttpParam;
import com.dobbinsoft.iotechn.core.annotation.HttpParamType;
import com.dobbinsoft.iotechn.core.annotation.param.NotNull;
import com.dobbinsoft.iotechn.core.exception.ServiceException;
import com.dobbinsoft.iotechn.core.model.Page;
import com.dobbinsoft.iotechn.device.dto.ProductDevDTO;

/**
 * Description: 为Developer提供的产品服务
 * User: rize
 * Date: 2020/6/17
 * Time: 14:47
 */
@HttpOpenApi(group = "product.dev", description = "为Developer提供的产品服务")
public interface ProductDevService {

    @HttpMethod(description = "创建")
    public String create(
            @NotNull @HttpParam(name = "product", type = HttpParamType.COMMON, description = "产品创建参数") ProductDevDTO product,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

    @HttpMethod(description = "列表")
    public Page<ProductDevDTO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer pageSize,
            @HttpParam(name = "title", type = HttpParamType.COMMON, description = "搜索标题") String title,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

    @HttpMethod(description = "删除")
    public String delete(
            @NotNull @HttpParam(name = "productId", type = HttpParamType.COMMON, description = "产品Id") Long productId,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

    @HttpMethod(description = "强行删除")
    public String deleteForce(
            @NotNull @HttpParam(name = "productId", type = HttpParamType.COMMON, description = "产品Id") Long productId,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

    @HttpMethod(description = "编辑")
    public String edit(
            @NotNull @HttpParam(name = "product", type = HttpParamType.COMMON, description = "产品创建参数") ProductDevDTO product,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

    @HttpMethod(description = "详情")
    public ProductDevDTO detail(
            @NotNull @HttpParam(name = "productId", type = HttpParamType.COMMON, description = "产品Id") Long productId,
            @NotNull @HttpParam(name = "developerId", type = HttpParamType.DEVELOPER_ID, description = "开发者Id") Long developerId) throws ServiceException;

}
